package com.xing.service;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service//注入到容器中--spring的@Service才能引用TicketService接口
public class UserService {

    @DubboReference //远程引用指定的服务，他会按照全类名进行匹配，看谁给注册中心注册了这个全类名(接口名:com.kuang.service.TicketService)
    TicketService ticketService;//引用, Pom坐标,可以定义路径相同的接口名

    public void bugTicket(){
        String ticket = ticketService.getTicket();
        System.out.println("在注册中心拿到"+ticket);
    }

}
